package br.infnet.projetoarquiteturajava.ws.service;

import javax.ejb.EJB;
import javax.ejb.Stateless;
import javax.inject.Inject;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.*;

import br.infnet.projetoarquiteturajava.ejb.ICEPServiceLocal;
import br.infnet.projetoarquiteturajava.ws.dto.AddressDTO;

@Stateless
@Path("/address")
public class CEPServiceWS {
	@EJB
	private ICEPServiceLocal bean;

	@GET
	@Produces(MediaType.APPLICATION_JSON)
	public AddressDTO getAddressbyCEP(@QueryParam("cep") String cep) {

		return bean.getAddressbyCEP(cep);
	}

}
